<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSampleTypeWorkflowsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sample_type_workflows', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('sample_type_id')->comment('样本类型ID');
            $table->unsignedInteger('workflow_id')->comment('工作流ID');
            $table->unsignedInteger('product_id')->nullable()->comment('产品ID');
            $table->unsignedTinyInteger('is_default')->default(0)->comment('是否默认，0:否,1:是');
            $table->unsignedInteger('created_by')->comment('创建者');
            $table->unsignedInteger('updated_by')->comment('更新者');
            $table->string('data_scope')->nullable()->comment('数据域');
            $table->timestamps();

            $table->comment = '样本类型下一步流向表';
            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sample_type_workflows');
    }

}
